package com.meisupic.copyright.controller;

import com.meisupic.copyright.domain.vo.MessageVo;
import com.meisupic.copyright.service.IMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.web.PageableDefault;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author lanjian
 * @Date 2018/4/7 下午6:06
 */
@RestController
@RequestMapping("/copyright/message")
public class MessageController extends BaseController {

  @Autowired
  private IMessageService messageService;

  @GetMapping("/list")
  public Page<MessageVo> list(@PageableDefault(sort = {"createTime"},direction= Direction.DESC) Pageable pageable) {
    return messageService.getPageMessageRecord(getUserId(), pageable);
  }

}
